import requests
from selenium import webdriver
import time

"""
['5uytoxQewcvIc1gn1PlNF0T2jbbOzRl5', 'act=ST', 'appid=2918', 'clienttime=1729565699179', 'clientver=1000', 
'dfid=1JbroK30Hkm23vlzM72EHVSv', 'id=4244440', 'mid=d92f359ff53524a9ecdbccb43b635cdb', 'type=yc', 'uuid=d92f359ff53524a9ecdbccb43b635cdb', 
'5uytoxQewcvIc1gn1PlNF0T2jbbOzRl5']

5uytoxQewcvIc1gn1PlNF0T2jbbOzRl5
appid: 2918
clientver: 1000
mid: d92f359ff53524a9ecdbccb43b635cdb
uuid: d92f359ff53524a9ecdbccb43b635cdb
dfid: 1JbroK30Hkm23vlzM72EHVSv
id: 4244440
type: yc
act: ST
clienttime: 1729565002479
signature: ecd5b3c1c5ffed12727f1678692ea3a6
"""

url = 'https://music.163.com/#/discover/toplist'

opt = webdriver.EdgeOptions()
opt.add_argument('--disable-infobars')
opt.add_experimental_option('excludeSwitches', ['enable-automation'])
opt.add_experimental_option('useAutomationExtension',False)

browser = webdriver.Edge(options=opt)
with open('./stealth.min.js') as f:
    browser.execute_cdp_cmd("Page.addScriptToEvaluateOnNewDocument", {
        "source": f.read()
    })
browser.get(url)
time.sleep(10)
html = browser.page_source
print(html)
browser.quit()